{% extends "page_templates/banner_base.html" %}
{% load facebook_tags %}
{% block community_block %}
	{% if logged_in_user %}
		<h3 id="games_joined">Games you have joined.</h3></br>
		{% if joined_games %}
			<table class="games_joined"><tr><th>Label</th><th>Game</th><th>Date</th><th>Time</th><th>City</th><th>State</th><th>Zip</th><th>Recurring Details</th><th>Intensity</th><th>            </th></tr>
				{% for joined_game in joined_games %}		
				<tr>
					<td>{{ joined_game.scheduled_game.label }}</td>
					<td>{{ joined_game.scheduled_game.game.name }}</td>
					<td>{{ joined_game.scheduled_game.date }}</td>
					<td>{{ joined_game.scheduled_game.time }}</td>
					<td>{{ joined_game.scheduled_game.city }}</td>
					<td>{{ joined_game.scheduled_game.state }}</td>
					<td>{{ joined_game.scheduled_game.zipcode }}</td>
					<td>{{ joined_game.scheduled_game.recurring_details }}</td>
					<td>{{ joined_game.scheduled_game.intensity }}</td>
					<td>
						{% if logged_in_user.username == joined_game.scheduled_game.creator_username|force_escape %}
							<p style="font-size: 9px">Your Scheduled Game</p>
						{% else %}
							<form action="." method="GET">
								<input type="hidden" name="m" value="{{ joined_game.scheduled_game.unique }}">
								<input type="submit" value="Leave">
							</form>
						{% endif %}
					</td>
				</tr>
				{% endfor %}
			</table>
		{% else %}
			<h4>None?! Get out there and give it the ole college try!</h4>
		{% endif %}
	{% else %}
		<h3>Login to see whats going on in your Friendlies community</h3>
	{% endif %}
	</br></br>
<div style="position:relative; right:-175px">
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'search',
  search: 'friendlysports OR friendlygames',
  interval: 6000,
  title: '',
  subject: 'share your competive spirit!',
  width: 700,
  height: 400,
  theme: {
    shell: {
      background: '#b5de11',
      color: '#ffffff'
    },
    tweets: {
      background: '#ffffff',
      color: '#444444',
      links: '#707cff'
    }
  },
  features: {
    scrollbar: true,
    loop: true,
    live: true,
    hashtags: true,
    timestamp: true,
    avatars: true,
    toptweets: true,
    behavior: 'default'
  }
}).render().start();
</script>
</div>
{% endblock %}
